package cn.ylz.ylmall.content.service;


import cn.ylz.ylmall.account.pojo.vo.PageData;
import cn.ylz.ylmall.account.security.CurrentPrincipal;
import cn.ylz.ylmall.content.pojo.param.ContentAddNewParam;
import cn.ylz.ylmall.content.pojo.vo.ContentListItemVO;
import cn.ylz.ylmall.content.pojo.vo.ContentStandardVO;
import cn.ylz.ylmall.content.pojo.vo.CountVO;
import org.springframework.transaction.annotation.Transactional;

@Transactional
public interface IContentService {
    /**
     * 发布内容
     * @param currentPrincipal
     * @param remoteAddr
     * @param contentAddNewParam
     */
    void addNew(CurrentPrincipal currentPrincipal, String remoteAddr, ContentAddNewParam contentAddNewParam);

    /**
     * 按id删除内容
     * @param id
     */
    void delete(Long id);

    /**
     * 按id查询内容详情
     * @param id
     * @return
     */
    ContentStandardVO getStandardById(Long id);

    PageData<ContentListItemVO> list(Integer pageNum);

    PageData<ContentListItemVO> listByCategoryId(Long categoryId, Integer pageNum);

    void update(Long id, Long likeCount, Long commentCount, Long collectCount);

    void updateContent(Long id,ContentAddNewParam contentAddNewParam);
}
